Skip to content

fix(chat): send bounded ACP image attachments#369

Open
keh4l wants to merge 1 commit into
xintaofei:mainfrom
keh4l:codex/upstream-acp-image-attachments
Open

fix(chat): send bounded ACP image attachments#369
keh4l wants to merge 1 commit into
xintaofei:mainfrom
keh4l:codex/upstream-acp-image-attachments

Conversation

@keh4l

@keh4l keh4l commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • route images from uploads, native/server pickers, drag-and-drop, and session attachments as inline ACP ImageContent
  • keep ordinary resource uploads on the existing 2 MiB path while adding a separately bounded 20,000,000-byte image reader with regular-file and special-file checks
  • treat mixed attachment batches as best-effort, clean image bytes from composer state after send/remove/unmount, and correct Grok's effective image capability based on verified inline-image support
  • raise only /api/acp_prompt to a 32 MiB request-body limit so a 20 MB image can survive base64/JSON expansion without widening adjacent APIs

Addresses #358.

Verification

  • pnpm eslint .
  • pnpm test — 211 files, 2608 tests passed
  • pnpm build — 32 static pages generated
  • focused attachment tests — 29 passed
  • focused Rust tests — image reader 6 passed, Grok capability 1 passed, ACP body limit 1 passed
  • cargo check --no-default-features --bin codeg-server
  • cargo test --no-default-features --bin codeg-server --lib — 1638 passed, 1 ignored
  • cargo clippy --no-default-features --bin codeg-server --lib -- -D warnings
  • cargo check --no-default-features --bin codeg-mcp
  • cargo clippy --no-default-features --bin codeg-mcp -- -D warnings

Notes

  • Desktop cargo check is not reported because this host lacks the GTK/GLib development packages required by glib-sys.
  • Full-repository cargo fmt --check already fails on upstream main; this PR introduces no additional failing file compared with that baseline.
  • No paid-model request was made. The Grok behavior was previously verified against 0.2.101/0.2.102 with inline ImageContent located outside the session worktree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants